package com.geovis.emergency.spd.entity.pc.pojo.dto;

import com.geovis.emergency.spd.entity.basic.entity.BasicDutyPost;
import com.geovis.emergency.spd.entity.pc.entity.PcDuty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * <p>
 * 应急预案指挥模块-值班机构DTO
 * </p>
 *
 * @author 曾德实
 * @since 2022-04-30
 */
@Getter
@Setter
@ToString(callSuper = true)
@Accessors(chain = true)
@ApiModel(value = "PcDrillDutyOrganDTO", description = "应急预案指挥模块-值班机构DTO")
public class PcDrillDutyOrganDTO implements Serializable {

    @ApiModelProperty("机构或人员ID")
    private String id;

    @ApiModelProperty("机构或人员名称")
    private String name;

    @ApiModelProperty("父类ID")
    private String parentId;

    @ApiModelProperty("标识 1-机构 2-人员")
    private String tag;

    public PcDrillDutyOrganDTO(PcDuty duty) {
        this.id = duty.getPersonId();
        this.name = duty.getPersonName();
        this.parentId = duty.getPostId();
        this.tag = "2";
    }

    public PcDrillDutyOrganDTO(BasicDutyPost post) {
        this.id = post.getId();
        this.name = post.getName();
        this.parentId = post.getParentId();
        this.tag = "1";
    }

}
